#include "mythread.h"

Mythread::Mythread(QTcpSocket *client,QByteArray ba)
{
    this->client = client;
    this->ba = ba;
}


void Mythread::run()
{
    client->write(ba);
    qDebug()<<"     current thread ID:"<<QThread::currentThreadId()<<'\n';
    qDebug() << "发送：";
    qDebug() << QString(ba);
    if (!client->waitForBytesWritten(500)) { // 等待数据发送完毕
        qWarning() << "Failed to send all data"<<client->errorString();
    }
}
